<div id="content_main">
    <h3>User</h3>
    <hr >
    <div class="user">
        <?php
        if (empty($hasil)) {
            echo "Tidak ada data user";
        } else {
            ?>

            <table>
                <tr>
                    <th> No </th>
                    <th> username </th>
                    <th> Akses </th>
                    <th> status </th>
                    <th> aksi </th>
                </tr>
                <?php
                $no = 1;
                foreach ($hasil as $valuser):
                    ?>
                    <tr>
                        <td> <?php echo $no; ?> </td>
                        <td> <?php echo $valuser->username; ?> </td>
                        <td> <?php echo $valuser->type; ?> </td>
                        <td> <?php echo $valuser->status; ?> </td>
                        <td><?php echo anchor('home/ubah_user/' . $valuser->id, 'Edit') . ' | ' . anchor('home/del_user/' . $valuser->id, 'Hapus'); ?></td>

                    </tr>
                    <?php
                    $no++;
                endforeach;
                ?>

            </table>

            <div class="tambah">
                <?php echo form_open('home/add_user'); ?>
                <label>Username</label><input type="text" name="username"/><br/>
                <label>password</label><input type="text" name="pass"/><br/>
                <label>Akses</label>
                <select name="akses">
                    <option value="admin">Admin</option>
                    <option value="guru">Guru</option>
                    <option value="siswa">Siswa</option>
                </select>
                <?php echo form_submit('submit', 'Add user'); ?>
                <?php echo form_close(); ?>
            </div>
            <?php
        }
        ?>

    </div>
</div>


